![]() |
PATH![]() |
![]() ![]() |
Opens a URL and starts an asynchronous download or upload operation.
OSStatus URLOpen (
URLReference urlRef,
FSSpec* fileSpec,
URLOpenFlags openFlags,
URLNotifyProcPtr notifyProc,
URLEventMask eventRegister,
void* userContext);
The URLOpen function starts an asynchronous download or upload operation and returns immediately. If the fileSpec parameter is a valid file specification, the URL Access Manager continues to transfer data until the transfer is complete.
To upload data, the fileSpec parameter must be an FSSpec structure.
To download data, the fileSpec parameter can be an FSSpec structure or NULL . If fileSpec is NULL , URLOpen starts the data transfer, but your application must call URLGetBuffer URLGetBuffer to complete the data transfer.
When URLOpen downloads data from a file:/// URL, the data fork is downloaded but the resource fork is not downloaded.
WARNING
Once you call URLOpen with urlRef , you cannot use the same urlRef to call URLOpen again, or to call URLDownload or URLUpload . If you need to call URLOpen , URLDownload , or URLUpload with a urlRef that has already been used for one of these calls, you need to create a new URL reference by calling URLNewReference .